package com.mdsoft.group.core;
import java.util.List;


public class Context {

	private static Context context;
	
	public static Context getInstance() {
		if (context == null) {
			context = new Context();
		}
		return context;
	}
	private Context() {
	}
	
	
	
	private AllChoose allChoose;
	private List<People> allPeople;
	private List<Group> allGroup;

	public AllChoose getAllChoose() {
		return allChoose;
	}
	public void setAllChoose(AllChoose allChoose) {
		this.allChoose = allChoose;
	}
	public List<People> getAllPeople() {
		return allPeople;
	}
	public void setAllPeople(List<People> allPeople) {
		this.allPeople = allPeople;
	}
	public List<Group> getAllGroup() {
		return allGroup;
	}
	public void setAllGroup(List<Group> allGroup) {
		this.allGroup = allGroup;
	}
	
	public float getTotalContentment() {
		float sum = 0.0f;
		System.out.print("[");
		for (Group group : allGroup) {
			System.out.print("[");
			for (People people : group) {
				System.out.print((int)group.checkContentment(people) + ", ");
				sum += group.checkContentment(people);
			}
			System.out.print("]");
		}
		System.out.print("]");
		return sum;
	}
}
